#ifndef APP_H
#define APP_H

#define _CRT_SECURE_NO_WARNINGS

#include <Windows.h>
#include <stdio.h>
#include <string.h>
#include <zstack/network.h>
#include <zstack/mem_op.h>
#include <zstack/bitops.h>
#include <zstack/types.h>
#include <zstack/time.h>
#include <zstack/error.h>

#define SERVER_PORT (6000)

struct user_cmd_t
{
    U32 cmd;
    U32 reg_addr;
    U32 bit_start;
    U32 bit_end;
    U32 bit_value;
    U32 bit_width;
};

extern RETCODE  user_cmd_parse(char* user_cmd, struct user_cmd_t* cmd);

extern void     frame_handler(S8* user_cmd, U32 user_cmd_len, U32* result);

extern int      frame_trx(void* arg);

extern const char* version;

#endif